package cn.com.gof.structure.decorator;

/**
 * <p>Title: ICar</p>  
 * <p>Description: </p>  
 * @author WangJun
 * @date 2018年9月7日 上午10:52:29
 */
public interface ICar {
	void move();
}

class Car implements ICar {
	@Override
	public void move() {
		System.out.println("陆地上跑");
	}
}
class SuperCar implements ICar {
	private ICar car;

	public SuperCar(ICar car) {
		super();
		this.car = car;
	}

	@Override
	public void move() {
		// TODO Auto-generated method stub
		car.move();
	}
	
	
}
class FlyCar extends SuperCar {

	public FlyCar(ICar car) {
		super(car);
	}
	public void fly() {
		System.out.println("在天上飞");
	}
	@Override
	public void move() {
		super.move();
		fly();
	}
}

class SwmiCar extends SuperCar {
	
	public SwmiCar(ICar car) {
		super(car);
	}
	public void Swming() {
		System.out.println("在水里游");
	}
	@Override
	public void move() {
		super.move();
		Swming();
	}
}